home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / v9n20.arc / PLUS_UD1.ASP < prev    next >
Text File  |  1990-10-29  |  7KB  |  239 lines

  1. ;
  2. ; PC MagNet Utilities Database Down Load Script,
  3. ; written for/with Procomm Plus v1.1b,
  4. ; by Rick Ayre 6.2.90.
  5. ;
  6.  
  7. ASSIGN S1 "EMPTY"      ; create five string variables,
  8. ASSIGN S2 "EMPTY"      ; and place the string EMPTY
  9. ASSIGN S3 "EMPTY"      ; in each
  10. ASSIGN S4 "EMPTY"
  11. ASSIGN S5 "EMPTY"
  12.  
  13. Main_Menu:     ; routine that paints the following message on the screen
  14.    CLEAR
  15.    MESSAGE "                                                         "
  16.    MESSAGE "                                                         "
  17.    MESSAGE "                       ┌┤ PC MagNet Utilities Database ├┐"
  18.    MESSAGE "                       │                                │"
  19.    MESSAGE "                       │       File to down load:       │"
  20.    MESSAGE "                       │         ____________           │"
  21.    MESSAGE "                       │                                │"
  22.    MESSAGE "                       └────────────────────────────────┘"
  23.    MESSAGE "^G"
  24.    MESSAGE "^G"
  25.  
  26. Get_File_Name:                  ; label for use by default case
  27.    LOCATE 10,54                 ; position cursor
  28.    MESSAGE "  "                 ; clear prompt area
  29.    LOCATE 5,33                  ; reposition cursor
  30.    GET S0 12                    ; get users choice
  31.    SWITCH S0
  32.       CASE "_NULL"              ; check to see if there IS a file name
  33.          GOTO What_Now
  34.       ENDCASE
  35.       DEFAULT
  36.          ISFILE S0              ; check to see if file already exists
  37.          IF SUCCESS
  38.             CLEAR
  39.             MESSAGE "File Exists - Get Anyway? (Y/N)"
  40.               GET S7
  41.               SWITCH S7
  42.                  CASE "N"
  43.                     GOTO Main_Menu
  44.                  ENDCASE
  45.                  DEFAULT
  46.                     GOTO File_Names
  47.                  ENDCASE
  48.               ENDSWITCH
  49.          ELSE
  50.             GOTO File_Names
  51.       ENDCASE
  52.    ENDSWITCH
  53.  
  54. File_Names:        ; routine to grab the file names and assign them to S1-S5
  55.    FIND S1 "EMPTY" ; check to see if S1 is empty
  56.    IF FOUND        ; if so,
  57.       ASSIGN S1 S0        ; put new file name in S1
  58.       GOTO Get_Another    ; and jumpt to next question
  59.    ENDIF                  ; if not
  60.    FIND S2 "EMPTY"        ; check to see if S2 is empty
  61.    IF FOUND               ; etc.
  62.       ASSIGN S2 S0
  63.       GOTO Get_Another
  64.    ENDIF
  65.    FIND S3 "EMPTY"
  66.    IF FOUND
  67.       ASSIGN S3 S0
  68.       GOTO Get_Another
  69.    ENDIF
  70.    FIND S4 "EMPTY"
  71.    IF FOUND
  72.       ASSIGN S4 S0
  73.       GOTO Get_Another
  74.    ENDIF
  75.    FIND S5 "EMPTY"
  76.    IF FOUND
  77.       ASSIGN S5 S0
  78.    ELSE
  79.       CLEAR
  80.       GOTO Log_On
  81.    ENDIF
  82.  
  83. Get_Another:       ; routine to ask if user wants another file
  84.    CLEAR
  85.    MESSAGE "                                                         "
  86.    MESSAGE "                                                         "
  87.    MESSAGE "                       ┌┤ Down Load Another? ├┐"
  88.    MESSAGE "                       │      (Y/N): _        │"
  89.    MESSAGE "                       └──────────────────────┘"
  90.    MESSAGE "^G"
  91.  
  92.    LOCATE 3 37
  93.    GET S8 1
  94.       FIND S5 "EMPTY"   ; check to see if S5 is empty
  95.       IF NOT FOUND      ; if not send user the following message
  96.          CLEAR
  97.          MESSAGE "Sorry, I can only down load five files at a time!"
  98.          PAUSE 5
  99.          GOTO Log_On
  100.       ENDIF
  101.       SWITCH S8
  102.          CASE "Y"
  103.             GOTO Main_Menu
  104.          ENDCASE
  105.          CASE "N"
  106.             GOTO Log_On
  107.          ENDCASE
  108.       ENDSWITCH
  109.  
  110. What_Now:          ; routine to recover from off line errors
  111.    CLEAR
  112.    MESSAGE "End This Script? (Y/N): "
  113.    GET S9 1
  114.    SWITCH S9
  115.       CASE "Y"
  116.          GOTO Get_Off
  117.       ENDCASE
  118.       CASE "N"
  119.      GOTO Main_Menu
  120.       ENDCASE
  121.    ENDSWITCH
  122.  
  123. Log_On:            ; routine to log on to CompuServe
  124.    FIND S1 "EMPTY"
  125.    IF FOUND
  126.     GOTO Get_Out
  127.    ENDIF
  128.    CLEAR
  129.    IF NOT LINKED
  130.       DIAL "1"        ; your Dialing Directory number goes in place of 1
  131.       PAUSE 1
  132.    ENDIF
  133.    TRANSMIT "^M"
  134.    WAITFOR "ost Name:  " 4
  135.    IF WAITFOR
  136.       PAUSE 1
  137.       TRANSMIT "cis^M"
  138.    ELSE
  139.       TRANSMIT "^M"
  140.    ENDIF
  141.    WAITFOR "User ID: "
  142.    PAUSE 1
  143.    TRANSMIT "######,###^M"     ; your UserID goes in place of "#"s
  144.    WAITFOR "Password: "
  145.    PAUSE 1
  146.    TRANSMIT "******.*******"  ; your password goes in place of "*"s
  147.    CLEAR
  148.    PAUSE 2
  149.    WAITFOR "New"
  150.    TRANSMIT "^C"
  151.    WAITFOR "M for prior MENU"
  152.  
  153. Get_File:          ; routine to navigate the PC MagNet Utilites Database
  154.    ASSIGN S0 S1    ; and down load a file
  155.    TRANSMIT "GO UTILIT^M"
  156.    WAITFOR "Utilities Database"
  157.    TRANSMIT "^C"
  158.    WAITFOR "M for prior MENU"
  159.    TRANSMIT "4^M"
  160.    WAITFOR "ample, DR.COM): "
  161.    PAUSE 1
  162.    TRANSMIT S0
  163.    TRANSMIT "^M"
  164.    WAITFOR "Utility Type:" 10
  165.    IF WAITFOR
  166.       TRANSMIT "^C"
  167.       WAITFOR "M for prior MENU"
  168.       TRANSMIT "Y^M"
  169.    ELSE
  170.       GOTO Error
  171.    ENDIF
  172.    WAITFOR "begin transfer" 15
  173.    PAUSE 1
  174.    TRANSMIT "^M"
  175.    WAITFOR "Kermit"
  176.    PAUSE 1
  177.    TRANSMIT "5^M"
  178.    WAITFOR "Downloading..."  ;**** This line, and the line that begins with GETFILE
  179.    PAUSE 2
  180.    GETFILE CISB  ;**** must both be deleted if you set ENQ = CIS B in Terminal Setup
  181.    WAITFOR "^M"
  182.    PAUSE 1
  183.  
  184.  
  185. Give_File_Name:            ; routine to pass file names to down load routine
  186.    FIND S5 "EMPTY"          ; check to see if S5 is empty
  187.    IF NOT FOUND             ; if not
  188.       ASSIGN S1 S5          ; put the file name in S1
  189.       ASSIGN S5 "EMPTY"     ; and put empty in S5
  190.       GOTO Get_File         ; if S5 is
  191.    ENDIF                    ; empty
  192.    FIND S4 "EMPTY"          ; check to see if S4 is empty
  193.    IF NOT FOUND             ; etc.
  194.       ASSIGN S1 S4
  195.       ASSIGN S4 "EMPTY"
  196.       GOTO Get_File
  197.    ENDIF
  198.    FIND S3 "EMPTY"
  199.    IF NOT FOUND
  200.       ASSIGN S1 S3
  201.       ASSIGN S3 "EMPTY"
  202.       GOTO Get_File
  203.    ENDIF
  204.    FIND S2 "EMPTY"
  205.    IF NOT FOUND
  206.       ASSIGN S1 S2
  207.       ASSIGN S2 "EMPTY"
  208.       GOTO Get_File
  209.    ELSE
  210.       GOTO Get_Off
  211.    ENDIF
  212.  
  213. Error:             ; routine to recover from online errors
  214.    CLEAR
  215.    MESSAGE "^G"
  216.    MESSAGE "Can't Find That File"
  217.    MESSAGE "Continue With Next? (Y/N)"
  218.    GET S6
  219.    SWITCH S6
  220.       CASE "Y"
  221.      GOTO Give_File_Name
  222.       ENDCASE
  223.       DEFAULT
  224.          GOTO Get_Off
  225.       ENDCASE
  226.    ENDSWITCH
  227.  
  228. Get_Off:           ; routine to log off
  229.    TRANSMIT "OFF^M"
  230.    PAUSE 3
  231.    TRANSMIT "OFF^M"
  232.    HANGUP
  233.  
  234. Get_Out:           ; routine to end script
  235.    CLEAR
  236.    MESSAGE "Thanks for using PC MagNet."
  237.    MESSAGE "^G"
  238.    EXIT
  239.